<?php

    ini_set("display_errors", 1);

    define('INCLUDES_DIR',              str_replace('\\', '/', dirname(__FILE__).'/'));
    define('CLASSES_DIR',               INCLUDES_DIR . 'classes/');

    define("CACHE_DIR",                 "cache/");

    $rootPath = dirname(__FILE__). '/../';
    $rootPath = str_replace('\\', '/', $rootPath);
    $rootPath = preg_replace('|/[^/]+?/\.\./|', '/', $rootPath);

    define("ROOT_PATH",         $rootPath);
    unset($rootPath);

    define("APP_LOG_FILE",              ROOT_PATH . 'logs/application_' . gmdate('Ymd', time()) . '.log');
    define("SPIDER_LOG_FILE",           ROOT_PATH . 'logs/spider_' . gmdate('Ymd', time()) . '.log');